package com.tas.test.controller;

import com.tas.test.pojo.entity.SimpleData;
import com.tas.test.service.SimpleDataService;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Inject;
import org.noear.solon.annotation.Mapping;

import java.util.List;

/**
 * @Author kevin
 * @Date 2022-06-21 14:05
 * @Description
 */
@Controller
public class SimpleDataController {

  @Inject
  private SimpleDataService simpleDataService;
  /**
   * 保存一条随机记录
   * @return
   */
  @Mapping("/save")
  public Long save(){
    return simpleDataService.save();
  }

  /**
   * 保存一条随机记录
   * @return
   */
  @Mapping("/query")
  public List<SimpleData> queryList(){
    return simpleDataService.queryList();
  }
}
